Hi,
how can I configure a fixed size of a dialog box? Which keyword/keyfunction does this for me?
In my DXL Reference I have found the function setSize(). The problem now is, that the size of the GUI box not adjusted to the test values w=1000 and h=300. You can read my code under this lines:
void makeBoxForFolderExport()
{
//Debug
print "N \n"
excelBox = create(dbExplorer, "IBM Rational DOORS DXL - Export Modules to Excel", styleCentered)
setSize(excelBox, 1000, 300)
//Do not parent to current module, use excelBox = create(dbExplorer, "String_Export_Excel", styleCentered)
//excelBox = centered LS_("String_Export_Excel", NLSTEMP_("Export Excel"))
//This for-loop is needed for excelTrigger, because trigger-function
//expects a module in parameter list, but we don't have a module because
//we will export modules in folder. So we have to "search" ANY module
Item i
for i in f do
{
currentModule = read(fullName(i), false, true)
if(currentModule != null) //If ANY module was found, break.
{
break
}
}
excelTrigger = trigger(module, close, 10, closeModuleTrig) //"Schliessen"-functionality of GUI
mainChoice = choice(excelBox, LS_("String__Main_column", NLSTEMP_("'Main' column:")), mainChoices, mainIgnore, 30, false)
mainView = choice(excelBox, LS_("String__Main_views", NLSTEMP_("'Main' views:")), mainViews, mainIntegrTest_Export, 30, false)
titleToggle = toggle(excelBox, LS_("String_Include_column_titles", NLSTEMP_("Include column titles")), includeColumnTitles)
preserveRichTextFormattingToggle = toggle(excelBox, LS_("String_Preserve_rich_text_formatting", NLSTEMP_("Preserve rich text formatting")), preserveRichTextFormatting)
//string choices[] = {"Standard spreadsheet", "Another spreadsheet"}
string choices[] = {"Standard spreadsheet", "Another Spreadsheet"}
templateChoice = radioBox(excelBox, "Export to: \n", choices, 0) //The last parameter sets, which choice should be activated
set(templateChoice, templateChoiceUpdate)
exportFileSelect = fileName(excelBox, "c:\\", "*.xl*", "Excel files", true)
inactive exportFileSelect
//Use apply here???
//ok(excelBox,LS_("String_Export", NLSTEMP_("Export")), doExcel)
apply(excelBox, "Export", doExcel)
//help(excelBox, DOORSHelp, helpExportExcel)
close(excelBox, true, closeDB)
//realize excelBox
//Debug
print "NN \n"
}
Thanks in advance for your response!
tobi_mehrl - Tue Nov 03 07:38:36 EST 2015 |
Re: Configure the size of a dialog box? Pekka_Makinen - Wed Nov 04 08:30:36 EST 2015 tobi_mehrl - Wed Nov 04 07:58:12 EST 2015
Yes, this lines I also read in my DXL Manual. But, why don't sets this function the Dialog Box to this values in my code above?
I also tried to specify values:
int w = 1000
int h = 300
setSize(excelBox, w, h)
This values also don't take effect...
Well, the explation for that is found in the documentation for setCenteredSize:
"This function must be placed after a call to the realize(pending) function, and before any further call to either the show(dialog box) or block functions."
so the example
DB dlg = create("Test Window", styleCentered |
styleFixed)
realize dlg
// both width and height are specified in pixels
setCenteredSize(dlg, 300, 100)
show dlg
|